<!DOCTYPE HTML>
<html>
 <head>
  <title>Forms</title>
  <script src="../../resources/testharness.js"></script>
  <script src="../../resources/testharnessreport.js"></script>
 </head>
 <body>
  <p>
    <h3>input_valueAsDate</h3>
  </p>
  <li>Date is showed in input when window is loaded.</li>
  <hr>

  <div id="log"></div>

  <form method="post"
      enctype="application/x-www-form-urlencoded"
      action=""
      name="input_form">
  <p><input type='date' id='input_date'></p>
  </form>

  <script>
    
    var input_date = document.getElementById("input_date");
    // Setting
    try {
      input_date.valueAsDate = new Date();
    } catch(e) {
      test(function() {
        assert_unreached("Failed to set valueAsDate attribute.");
      });
    }

    // Getting
    if (input_date.valueAsDate != null) {
      if (typeof(input_date.valueAsDate) != "object") {
        test(function() {
          assert_true(false, "valueAsDate attribute is not correct.");
        });
      }
    } else {
      test(function() {
        assert_unreached("Failed to get valueAsDate attribute.");
      });
    }
    
  </script>

 </body>
</html>